ImagXpress 13 for ActiveX - User Guide > How To > Process an Image > Specify a Part of the Image to Process |
Prior to performing image processing on an image, you must specify whether the entire image, or a section of the image, should be processed. The ImagXpress® control provides two vehicles for specifying a section of the image to be processed:
If either an Area or a Region are defined, processing will apply only to that Area or Region. If both an Area and a Region are enabled and defined, then the last one to be set will be used. |
When RgnEnabled or the Area method's IPArea parameter is True, additional memory is required to store the original image to be merged with the area/region processed. If Area/Region processing is not needed, set RgnEnabled and the Area method's IPArea parameter to False to reduce memory usage. |
To create a region:
A RubberBand can be created to define a rectangular region on the display. First create the rubberband, then use the RubberBandH, RubberBandL, RubberBandT, and RubberBandW properties to populate the X and Y coordinates in RgnAddPoint. |
The RgnX, RgnY, RgnWidth, and RgnHeight properties (read only) provide status on the current position and size of the region.
Call RgnCreateSprite to create a Sprite by copying the current region into a transparent window. The sprite can then be moved (RgnMoveSprite) or pasted (RgnPasteSprite) to the image that is currently being viewed. The RgnSpriteX and RgnSpriteY properties define the upper left corner of the rectangle bounding the sprite. If the Viewer is assigned a different image to display, the Sprite remains in effect and can be moved or pasted in the new image being viewed. To delete the sprite and free up the resources associated with it, call RgnDeleteSprite.
Deleting the sprite does not make any changes to the image being viewed. |
To enable the region, set the RgnEnabled property. When the region has been enabled, all image processing methods act on the region instead of the entire image. When the RegionEnabled property is False, the entire image is processed.
To delete a region object and free up the associated memory, call the RgnDelete method (there is no impact on the image).
An area is a rectangular subset of the image. When the area is enabled (IPArea = true), image processing is performed on the area of the image only.
The RemoveRedeye, RemoveDust, and RemoveScratches methods require that an area be set to specify a subset of the image to process. For all other methods and properties, setting an area is optional. |
To create an Area, call the Area method with a specified rectangular bounding area. Since only one area can be defined for each ImagXpress control, calling Area will delete the previous area.
A RubberBand can be created to define a rectangular region on the display. First create the rubberband, then use the RubberbandH, RubberBandL, RubberBandT, and RubberBandW properties to populate the coordinates in Area. |
The size, location, and status of an area can be identified, using the following properties: IPAreaX, IPAreaY, IPAreaWidth, IPAreaHeight and IPArea.
A Sprite cannot be created from an Area. To create a sprite, first copy the area to a region, then create the sprite.
Calling the Area method will replace the current area with a newly defined area.